package com.gimi.cloud.jimi.app.consumer.feign.hystrix;

import com.gimi.cloud.jimi.app.consumer.feign.HomePageFeignService;
import com.gimi.cloud.jimi.common.enums.ResponseCodeEnum;
import com.gimi.cloud.jimi.common.utils.JsonUtil;
import com.gimi.cloud.jimi.common.utils.reqhead.Response;
import com.gimi.cloud.jimi.dto.app.ColumnProdDTO;
import com.gimi.cloud.jimi.dto.base.BaseDTO;
import com.gimi.cloud.jimi.dto.user.UserDTO;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * Created by shazhiwei on 2017/12/27.
 */
@Component
public class HomePageHystrix implements HomePageFeignService{
    private static Logger logger = LoggerFactory.getLogger(HomePageHystrix.class);

    @Override
    public String columnList(BaseDTO param) {
        logger.error("===>熔断返回");
        Response resp = new Response();
        resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
        return JsonUtil.toJson(resp);
    }

    @Override
    public String adList(BaseDTO param) {
        logger.error("===>熔断返回");
        Response resp = new Response();
        resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
        return JsonUtil.toJson(resp);
    }

	@Override
	public String columnProdList(ColumnProdDTO dto) {
		logger.error("===>熔断返回");
        Response resp = new Response();
        resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
        return JsonUtil.toJson(resp);
	}

	@Override
	public String getAuthenticationStatus(UserDTO dto) {
		logger.error("===>熔断返回");
        Response resp = new Response();
        resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
        return JsonUtil.toJson(resp);
	}

	@Override
	public String getAuthenticationInfo(UserDTO dto) {
		logger.error("===>熔断返回");
        Response resp = new Response();
        resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
        return JsonUtil.toJson(resp);
	}
}
